package com.thinkgem.jeesite.cn.yy.serviceimpl;

import com.thinkgem.jeesite.cn.yy.entity.ProTableCol;
import com.thinkgem.jeesite.cn.yy.service.SQLsService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by jws24 on 2017/12/1.
 */
@Service("sqlsService")
@Transactional
public class SQLServiceImpl implements SQLsService{

    @Resource
    SQLsService sqlService;

    @Transactional(propagation= Propagation.NOT_SUPPORTED)
    public List<Map<String,String>> pro() {
        return sqlService.pro();
    }

    @Transactional(propagation= Propagation.NOT_SUPPORTED)
    public List<Map<String,Object>> tab(@Param(value = "pro_id") int proId) {
        return sqlService.tab(proId);
    }


    public List<ProTableCol> col(@Param(value = "tab_id") int tabId) {
        return sqlService.col(tabId);
    }


    public List<Map<String, String>> proName(@Param(value = "pro_id") int proId) {
        return sqlService.proName(proId);
    }
    public List<Map<String,String>> tabName(@Param(value = "tab_id")int tabId){
        return sqlService.tabName(tabId);
    }


    public List<Map<String, Object>> cid(@Param(value = "tab_id") int tabId) {
        return sqlService.cid(tabId);
    }


    public Map<String, String> name(@Param(value = "tab_id") int tabId, @Param(value = "col_cid") int colCid) {
        return sqlService.name(tabId, colCid);
    }


    public Map<String, String> type(@Param(value = "tab_id") int tabId, @Param(value = "col_cid") int colCid) {
        return sqlService.type(tabId, colCid);
    }
     //
    @Transactional(propagation= Propagation.NOT_SUPPORTED)
    public Map<String, Object> length(@Param(value = "tab_id") int tabId, @Param(value = "col_cid") int colCid) {
        return sqlService.length(tabId, colCid);
    }

    public Map<String, Object> isNull(@Param(value = "tab_id") int tabId, @Param(value = "col_cid") int colCid) {
        return sqlService.isNull(tabId, colCid);
    }


    public Map<String, String> restrict(@Param(value = "tab_id") int tabId, @Param(value = "col_cid") int colCid) {
        return sqlService.restrict(tabId, colCid);
    }

    public int count(@Param(value = "tab_id") int tabId) {
        return sqlService.count(tabId);
    }
}